package bitOperation;

/*
 *@description 只出现一次的数字 II
 *@author hkfan
 *@version 1.0
 *@create 2025/6/23 16:50
 */
public class LeetCode_137 {

    public int singleNumber(int[] nums) {
        int res = 0;
        for (int i = 0; i < 32; i++) {
            int count = 0;
            for (int num : nums) {
                count=count+(num>>i)&1;
            }
            res|=(count%3)<<i;
        }
        return res;
    }

}
